﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using XLua;
[LuaCallCSharp]
public class TextLua
{
    private static Text m_transform;

    public static void On(uint skinID)
    {
        GameObject go = ObjectManager.Instance.GetGameObject(skinID);
        if (go != null)
        {
            m_transform = go.GetComponent<Text>();
        }
    }

    public static void Off()
    {
        m_transform = null;
    }

    public static void SetText(uint skinID, string text)
    {
        On(skinID);
        SetText(text);
    }

    public static void SetText(string text)
    {
        if (m_transform == null) return;
        m_transform.text = text;
    }
}

